/*
 * Yabumi, a 2d scrolling shoot-em-up game.
 * Copyright (C) 2003 Gemma Teruaki <terugen@yabumi.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
 */

#ifndef _MUSASHI_H_
#define _MUSASHI_H_

/* includes begin */ 
#ifndef _TASKMANAGER_H_
/* need ONETIME_COUNT task _option _tasklist*/
#include "../taskmanager.h"
#endif
#ifndef _HITCIRCLE_H_
/* need _was_hit, _weapon */
#include "hitcircle.h"
#endif
/* need SDL_Surface */
#include <SDL.h>
#include <stdbool.h>
/* includes end */

/* constants begin */
#define MUSASHI_MAX_SPEED (500)
#define MUSASHI_ROTATE_SPEED (2)
#define MUSASHI_SHIELD (250)
#define MUSASHI_FIRE_MISSILE_WAIT (ONETIME_COUNT + 7)
#define MUSASHI_KILL_WAIT (ONETIME_COUNT + 25)
/* constants end */

/* typedef begin */
typedef struct {
  bool fire;
  _was_hit was_hit;
} _musashi_tasks;

typedef struct {
  bool fire;
} _musashi_waits;

typedef struct {
  int x, y;
  int dx, dy;
  int angle;
  int shield;
  _musashi_tasks tasks;
  _musashi_waits waits;
  /* _list_item *root; !!!circular reference!!! */
  void *root;
} _Musashi;
/* typedef end */

/* Global Objects */
extern SDL_Surface *Sprite_Musashi[3][360];
/* !!!circular reference!!! */
/* extern _list_header player_list_header; */

/* Prototypes from the musashi.c file. */
void Musashi_Init();
void Musashi_Free();
_Musashi *Musashi_Create(int x, int y, int dx, int dy, int angle);
task Musashi_Add(_option *optv);
task Musashi_Move(_option *optv);
task Musashi_Draw(_option *optv);
task Musashi_Fire(_option *optv);
task Musashi_was_Hit(_option *optv);
task Musashi_was_Hit_by_Missile(_option *optv);
task Musashi_was_Hit_by_Flame(_option *optv);
task Musashi_was_Hit_by_Homing(_option *optv);
task Musashi_Kill(_option *optv);
#endif
